package cn.ac.siom.query.service.impl;


import cn.ac.siom.query.dao.ITab_orgDAO;
import cn.ac.siom.query.service.ITab_orgService;
import cn.ac.siom.query.vo.Tab_org;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class Tab_orgServiceImpl implements ITab_orgService {

    @Resource
    private ITab_orgDAO tab_orgDAO;

    @Override
    public Map findAllParams(Map params) throws Exception {
        List<Map> list=this.tab_orgDAO.findAllParams(params);
        Integer count=this.tab_orgDAO.findCount();
        Map map = new HashMap();
        map.put("data",list);
        map.put("count",count);
        map.put("page_id",params.get("page_id"));
        return map;
    }

    @Override
    public List<Tab_org> list() throws SQLException {
        return this.tab_orgDAO.findAll();
    }

    @Override
    public List<Tab_org> list_NO(Integer i_id) throws SQLException {
        List<Tab_org> tab_org=this.tab_orgDAO.findNo(i_id);
        return tab_org;
    }

    @Override
    public List<Tab_org> list_page(Integer rownum, Integer page_id) throws SQLException {
        List<Tab_org> tab_org=this.tab_orgDAO.findPage(rownum,page_id);
        return tab_org;
    }

    @Override
    public Integer list_count() throws SQLException {
        Integer  tab_org=this.tab_orgDAO.findCount();
        return tab_org;
    }

    @Override
    public String list_Http(Integer i_id) throws SQLException {
        return this.tab_orgDAO.find_Http(i_id);
    }
}
